//
//  LGPersonalTitleView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/2/14.
//  图标+标题+内容  Screen_W 、 viewPix(44)

#import "LGPersonalTitleView.h"

@interface LGPersonalTitleView()
/**   */
@property (nonatomic , strong)UIImageView *iconView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;
/**   */
@property (nonatomic , strong)UILabel *contentLabel;

@end

@implementation LGPersonalTitleView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.iconView];
        [self addSubview:self.titleLabel];
        [self addSubview:self.contentLabel];
    }
    return self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    self.contentLabel.text = content;
}

-(void)viewWithIcon:(NSString *)iconName title:(NSString *)title{
    self.iconView.image = [UIImage imageNamed:iconName];
    self.titleLabel.text = title;
}


-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithFrame:CGRectMake(viewPix(16), viewPix(14), viewPix(16), viewPix(16))];
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:1];
        _titleLabel.frame = CGRectMake(viewPix(36), 0, viewPix(70)+iPadMargin(10), viewPix(44));
    }
    return _titleLabel;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"" colorString:@"#666666" textFont:LGFont(16) textAlignment:NSTextAlignmentRight lines:1];
        _contentLabel.frame = CGRectMake(viewPix(120), 0, Screen_W-viewPix(136), viewPix(44));
    }
    return _contentLabel;
}


@end
